package com.hz.ruoyifarmbase.farm.service.impl;

import java.util.List;

import com.hz.ruoyifarmbase.farm.domain.AgrBaseOperate;
import com.hz.ruoyifarmbase.farm.domain.vo.AgrAppProcess;
import com.hz.ruoyifarmbase.farm.mapper.AgrBaseOperateMapper;
import com.hz.ruoyifarmbase.farm.service.IAgrBaseOperateService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 作物种植操作Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class AgrBaseOperateServiceImpl implements IAgrBaseOperateService
{
    @Autowired
    private AgrBaseOperateMapper agrBaseOperateMapper;

    /**
     * 查询作物种植操作
     *
     * @param operateId 作物种植操作主键
     * @return 作物种植操作
     */
    @Override
    public AgrBaseOperate selectAgrBaseOperateByOperateId(Long operateId)
    {
        return agrBaseOperateMapper.selectAgrBaseOperateByOperateId(operateId);
    }

    /**
     * 查询作物种植操作列表
     *
     * @param agrBaseOperate 作物种植操作
     * @return 作物种植操作
     */
    @Override
    public List<AgrBaseOperate> selectAgrBaseOperateList(AgrBaseOperate agrBaseOperate)
    {
        return agrBaseOperateMapper.selectAgrBaseOperateList(agrBaseOperate);
    }

    /**
     * 新增作物种植操作
     *
     * @param agrBaseOperate 作物种植操作
     * @return 结果
     */
    @Override
    public int insertAgrBaseOperate(AgrBaseOperate agrBaseOperate)
    {
        agrBaseOperate.setCreateTime(DateUtils.getNowDate());
        return agrBaseOperateMapper.insertAgrBaseOperate(agrBaseOperate);
    }

    /**
     * 修改作物种植操作
     *
     * @param agrBaseOperate 作物种植操作
     * @return 结果
     */
    @Override
    public int updateAgrBaseOperate(AgrBaseOperate agrBaseOperate)
    {
        agrBaseOperate.setUpdateTime(DateUtils.getNowDate());
        return agrBaseOperateMapper.updateAgrBaseOperate(agrBaseOperate);
    }

    /**
     * 批量删除作物种植操作
     *
     * @param operateIds 需要删除的作物种植操作主键
     * @return 结果
     */
    @Override
    public int deleteAgrBaseOperateByOperateIds(Long[] operateIds)
    {
        return agrBaseOperateMapper.deleteAgrBaseOperateByOperateIds(operateIds);
    }

    /**
     * 删除作物种植操作信息
     *
     * @param operateId 作物种植操作主键
     * @return 结果
     */
    @Override
    public int deleteAgrBaseOperateByOperateId(Long operateId)
    {
        return agrBaseOperateMapper.deleteAgrBaseOperateByOperateId(operateId);
    }

    @Override
    public List<AgrAppProcess> getProcessByBatchId(Long batchId) {
        return agrBaseOperateMapper.getProcessByBatchId(batchId);
    }
}
